import axios from "@/axios"

export function getFlighData(param) {
    if (param.flightno && param.exec_date) {
        console.log('xxxxx',`${window.gloableConfig.apiReqUrl}/dmp/apiservice/data/${window.gloableConfig.mode_1.reqUrlconfig}?token=${window.gloableConfig.mode_1.token}&flightno=${param.flightno}&exec_date=${param.exec_date}`)
        return axios.get(`${window.gloableConfig.apiReqUrl}/dmp/apiservice/data/${window.gloableConfig.mode_1.reqUrlconfig}?token=${window.gloableConfig.mode_1.token}&flightno=${param.flightno}&exec_date=${param.exec_date}`)
    } else if(!param.flightno && param.exec_date) {
        console.log('yyyy',`${window.gloableConfig.apiReqUrl}/dmp/apiservice/data/${window.gloableConfig.mode_2.reqUrlconfig}?token=${window.gloableConfig.mode_2.token}&exec_date=${param.exec_date}`)
        return axios.get(`${window.gloableConfig.apiReqUrl}/dmp/apiservice/data/${window.gloableConfig.mode_2.reqUrlconfig}?token=${window.gloableConfig.mode_2.token}&exec_date=${param.exec_date}`)
    } else if (param.flightno && !param.exec_date) {
        // return axios.get(`/dmp/apiservice/data/${window.gloableConfig.reqUrlconfig}?token=${window.gloableConfig.token}&flightno=${param.flightno}`)
    }
}
